<fieldset>
  <legend>Shim finder</legend>
  <% form_tag(shim_finder_url, :method => :get, :class => "shim_finder") do %>
    <table>
      <tr>
        <th class="source">Source service</th>
        <th class="shim">Shim</th>
        <th class="destination">Destination service</th>
      </tr>
      <tr>
        <td class="source">
          <%= select_tag('source_service_id', '<option value="">N/A</option>' + 
              options_from_collection_for_select(Service.find(:all, :order => :name), 
                  :id, :name, @source.to_i))%>
        </td>
        <td class="shim">
          <span class="checkboxes"><br />
            <% Shim::SHIM_TYPES.each do |t| %>
              <%= check_box_tag "show[#{t}]", "1", @box[t] -%><%= h(t)+"s" %><br/>
            <% end %>
          </span>
        </td>
        <td class="destination">
          <%= select_tag('destination_service_id', '<option value="">N/A</option>' + 
              options_from_collection_for_select(Service.find(:all, :order => :name),
                  :id, :name, @dest.to_i))%>
        </td>
      </tr>
    </table>      
    <%= submit_tag 'Search' %>
    
    <br /><br /><br />
    This is still work in progress.  Eventually, we would like you to be able 
    to search for shims that can be based on the given services.   
    
  <% end %>
  <% if @results.blank? %>
    <% unless @source.blank? && @dest.blank? %>
      No results found.
    <% end %>
  <% else %>
    <%= pluralize(@results_count, "result")%> found. <br />
    <%= render :partial => 'shims/shim', :collection => @results %>
    <%= will_paginate @results %>
  <% end %>
</fieldset>